package com.jiuyin.dianjing.util;

import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;

/**
 * 剪切板工具
 */
public class ClipBoardUtil {
    private static ClipboardManager clipboardManager;

    private ClipBoardUtil() {

    }

    public static void copy(Context context, String content) {
        if (null == clipboardManager) {
            clipboardManager = context.getSystemService(ClipboardManager.class);
        }
        clipboardManager.setPrimaryClip(ClipData.newPlainText("copy", content));
    }
}
